<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function myCalculator(num) {
            const that = this
            that.num = num || 0;
            myCalculator.prototype.plus = function (num) {
                that.num += +num;
                return myCalculator.prototype
            };
            myCalculator.prototype.minus = function (num) {
                that.num -= +num;
                return myCalculator.prototype
            };
            myCalculator.prototype.times = function (num) {
                that.num *= +num;
                return myCalculator.prototype
            };
            myCalculator.prototype.dividedBy = function (num) {
                that.num /= +num;
                return myCalculator.prototype
            };
            myCalculator.prototype.equals = function () {
                return that.num
            }

            return myCalculator.prototype
        }
        console.log(myCalculator(121).plus(1).minus(2).times(3).dividedBy(4).equals());
         // 90
    </script>
</body>

</html>